import pymysql

class DB:
    def __init__(self):
        self.conn=pymysql.connect(host='localhost',port=3306,user='root',passwd='root',db='workf9',charset='utf8',cursorclass=pymysql.cursors.DictCursor)
        self.cousor=self.conn.cursor()

    def insert(self,sql):
        self.cousor.execute(sql)
        self.conn.commit()
    def find(self,sql):
        self.cousor.execute(sql)
        self.cousor.fetchone()
    def findall(self,sql):
        self.cousor.execute(sql)
        self.cousor.fetchall()
    def close(self):
        self.cousor.close
        self.conn.close()

db1=DB()